import Vue from "vue";
import VueRouter from "vue-router";

import Hot from "./views/hot.vue";
import Movie from "./views/movie.vue";
import Top from "./views/top.vue";
import Detail from "./views/detail.vue";

Vue.use(VueRouter);

const router = new VueRouter({
  // 路由规则
  routes: [
    {
      path: "/",
      redirect: "/hot"
    },
    {
      path: "/hot",
      component: Hot
    },
    {
      path: "/movie",
      component: Movie
    },
    {
      path: "/top",
      component: Top
    },
    {
      path: "/detail/:id",
      component: Detail
    }
  ]
});

export default router;
